package launcher;

import multicast.MulticastCommsClient;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import constants.NetworkConstants;

import client.FileStoreClient;

import ui.FileStoreClientUI;

public class ClientLauncher {
	
	public static void main(String[] args) {
		//FileStoreClient client = new FileStoreClient();
		Display display = Display.getDefault();
		Shell shell = new Shell(display);
		FileStoreClientUI inst = new FileStoreClientUI(shell, SWT.NULL);

		//inst.addClient(client);
		Point size = inst.getSize();
		shell.setLayout(new FillLayout());
		shell.layout();
		if(size.x == 0 && size.y == 0) {
			inst.pack();
			shell.pack();
		} else {
			Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);
			shell.setSize(shellBounds.width, shellBounds.height);
		}
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}

	}
}
